home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / VBDLH02.ZIP / VBDE_SRC.ZIP / VBDEABT.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-03-08  |  8.0 KB  |  205 lines

  1. VERSION 2.00
  2. Begin Form frmAbout 
  3.    BackColor       =   &H8000000F&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "About"
  6.    ClientHeight    =   3720
  7.    ClientLeft      =   1395
  8.    ClientTop       =   1905
  9.    ClientWidth     =   5100
  10.    ClipControls    =   0   'False
  11.    FontBold        =   0   'False
  12.    FontItalic      =   0   'False
  13.    FontName        =   "System"
  14.    FontSize        =   13.5
  15.    FontStrikethru  =   0   'False
  16.    FontUnderline   =   0   'False
  17.    Height          =   4095
  18.    HelpContextID   =   8
  19.    Icon            =   0
  20.    Left            =   1350
  21.    LinkTopic       =   "Form2"
  22.    MaxButton       =   0   'False
  23.    MinButton       =   0   'False
  24.    MousePointer    =   1  'Arrow
  25.    ScaleHeight     =   3720
  26.    ScaleWidth      =   5100
  27.    Top             =   1575
  28.    Width           =   5190
  29.    Begin CommandButton cmdOK 
  30.       Cancel          =   -1  'True
  31.       Caption         =   "&OK"
  32.       Default         =   -1  'True
  33.       FontBold        =   0   'False
  34.       FontItalic      =   0   'False
  35.       FontName        =   "System"
  36.       FontSize        =   13.5
  37.       FontStrikethru  =   0   'False
  38.       FontUnderline   =   0   'False
  39.       Height          =   495
  40.       Left            =   600
  41.       TabIndex        =   2
  42.       Top             =   3000
  43.       Width           =   1095
  44.    End
  45.    Begin Image imgIcon 
  46.       Height          =   495
  47.       Left            =   960
  48.       Top             =   480
  49.       Width           =   495
  50.    End
  51.    Begin Label lblCopyright2 
  52.       Alignment       =   2  'Center
  53.       AutoSize        =   -1  'True
  54.       BackStyle       =   0  'Transparent
  55.       Caption         =   "lblCopyright2"
  56.       FontBold        =   0   'False
  57.       FontItalic      =   0   'False
  58.       FontName        =   "System"
  59.       FontSize        =   13.5
  60.       FontStrikethru  =   0   'False
  61.       FontUnderline   =   0   'False
  62.       Height          =   270
  63.       Left            =   480
  64.       TabIndex        =   3
  65.       Top             =   1560
  66.       Width           =   1335
  67.    End
  68.    Begin Label lblCopyright1 
  69.       Alignment       =   2  'Center
  70.       AutoSize        =   -1  'True
  71.       BackStyle       =   0  'Transparent
  72.       Caption         =   "lblCopyright1"
  73.       FontBold        =   0   'False
  74.       FontItalic      =   0   'False
  75.       FontName        =   "System"
  76.       FontSize        =   13.5
  77.       FontStrikethru  =   0   'False
  78.       FontUnderline   =   0   'False
  79.       Height          =   270
  80.       Left            =   510
  81.       TabIndex        =   1
  82.       Top             =   1080
  83.       Width           =   1335
  84.    End
  85.    Begin Label lblTitle 
  86.       Alignment       =   2  'Center
  87.       AutoSize        =   -1  'True
  88.       BackStyle       =   0  'Transparent
  89.       Caption         =   "lblTitle"
  90.       FontBold        =   0   'False
  91.       FontItalic      =   0   'False
  92.       FontName        =   "System"
  93.       FontSize        =   13.5
  94.       FontStrikethru  =   0   'False
  95.       FontUnderline   =   0   'False
  96.       Height          =   270
  97.       Left            =   855
  98.       TabIndex        =   0
  99.       Top             =   120
  100.       Width           =   645
  101.    End
  102.    Begin Image imgCat 
  103.       Height          =   3375
  104.       Left            =   2160
  105.       Picture         =   VBDEABT.FRX:0000
  106.       Top             =   120
  107.       Visible         =   0   'False
  108.       Width           =   2640
  109.    End
  110. '====================================================
  111. 'Sample VB program using UNLHA.DLL routine
  112. 'VBDeAbt.Frm    (frmAbout)
  113. ' Original: Niiyama(HEROPA) SGV00153@niftyserve.or.jp
  114. ' English : Hitoshi Ozawa   h_ozawa@bekkoame.or.jp
  115. '====================================================
  116. Option Explicit
  117. Dim mintDblClickCount As Integer
  118. Const CTL_SPACE = 16
  119. Sub cmdOK_Click ()
  120.     Unload Me
  121. End Sub
  122. Sub Form_Load ()
  123.     'Set properties
  124.     imgIcon.Picture = frmArchive.Icon
  125.     Caption = "About " & APP_CAPTION
  126.     lblTitle.Caption = APP_CAPTION & " " & APP_VERSION
  127.     lblCopyright1.Caption = "Copyright(C) " & APP_DATE & " " & APP_COPYRIGHT & Chr$(13) & APP_COPYRIGHT2 & Chr$(13) & Chr$(13) & "Translated to English by " & APP_COPYRIGHT3 & Chr$(13) & APP_COPYRIGHT4 & Chr$(13) & APP_COPYRIGHT5
  128.     lblCopyright2.Caption = "UNLHA.DLL Version " & Format$((UnlhaGetVersion() / 100), "Fixed") & Chr$(13) & "Copyright(C) 1995 Micco"
  129.     Call SetControlPosition
  130.     Call SetControl3D
  131.     'Set Help context ID
  132.     Me.HelpContextID = HLP_DLGABOUT
  133.     'Display form at center of screen
  134.     Call SetChildWindowPos(frmArchive, Me)
  135.     Call DeleteSwitchTo(Me)
  136. End Sub
  137. Sub imgIcon_DblClick ()
  138.     mintDblClickCount% = mintDblClickCount% + 1
  139.     If mintDblClickCount% < 3 Then Exit Sub
  140.     mintDblClickCount% = 3
  141.     lblTitle.Visible = False
  142.     lblCopyright1.Visible = False
  143.     lblCopyright2.Visible = False
  144.     imgIcon.Visible = False
  145.     imgCat.Visible = True
  146.     Me.Caption = "Me"
  147. End Sub
  148. 'Set button height depending on font size
  149. Sub SetButtonHeight (Ctl As Control)
  150. Dim saveFontName As String, saveFontSize As Single
  151.     'Save control parent FontName & FontSize
  152.     saveFontName = Ctl.Parent.FontName
  153.     saveFontSize = Ctl.Parent.FontSize
  154.     Ctl.Parent.FontName = Ctl.FontName
  155.     Ctl.Parent.FontSize = Ctl.FontSize
  156.     Ctl.Height = Ctl.Parent.TextHeight(CStr(Ctl.Caption)) + 12 * Screen.TwipsPerPixelY
  157.     'Restore control parent FontName & FontSize
  158.     Ctl.Parent.FontName = saveFontName
  159.     Ctl.Parent.FontSize = saveFontSize
  160. End Sub
  161. Sub SetControl3D ()
  162.     'Draw 3D panel
  163.     Me.AutoRedraw = True
  164.     Call Draw3DForm(Me)
  165.     Call Draw3DLine(Me, 20 * Screen.TwipsPerPixelX, (lblCopyright2.Top - CTL_SPACE% * Screen.TwipsPerPixelY) - 2 * Screen.TwipsPerPixelY, Me.ScaleWidth - 20 * Screen.TwipsPerPixelX, (lblCopyright2.Top - CTL_SPACE% * Screen.TwipsPerPixelY) - 2 * Screen.TwipsPerPixelY, 0)
  166.     Me.AutoRedraw = False
  167. End Sub
  168. Sub SetControlPosition ()
  169.     Dim intFormSysVSize As Integer
  170.     Dim intFormSysHSize As Integer
  171.     Dim intCtlMaxWidth  As Integer
  172.     mintDblClickCount% = 0  'initialization
  173.     'Set About.frm's system vertical size
  174.     intFormSysVSize% = (GetSystemMetrics(SM_CYDLGFRAME) * 2 + GetSystemMetrics(SM_CYCAPTION)) * Screen.TwipsPerPixelY
  175.     'Set About.frm's system horizontal size
  176.     intFormSysHSize% = (GetSystemMetrics(SM_CXDLGFRAME) * 2 + 2) * Screen.TwipsPerPixelX
  177.     'Set space to half icon size
  178.     Call SetButtonHeight(cmdOK)
  179.     'Set to maximum width
  180.     intCtlMaxWidth = lblTitle.Width
  181.     If intCtlMaxWidth < lblCopyright1.Width Then intCtlMaxWidth = lblCopyright1.Width
  182.     If intCtlMaxWidth < imgIcon.Width Then intCtlMaxWidth = imgIcon.Width
  183.     If intCtlMaxWidth < lblCopyright2.Width Then intCtlMaxWidth = lblCopyright2.Width
  184.     If intCtlMaxWidth < cmdOK.Width Then intCtlMaxWidth = cmdOK.Width
  185.     intCtlMaxWidth = intCtlMaxWidth + CTL_SPACE% * 2 * Screen.TwipsPerPixelX
  186.     'Set height of each property
  187.     lblTitle.Top = CTL_SPACE% * Screen.TwipsPerPixelY
  188.     imgIcon.Top = CTL_SPACE% * Screen.TwipsPerPixelY \ 2 + lblTitle.Top + lblTitle.Height
  189.     lblCopyright1.Top = CTL_SPACE% * Screen.TwipsPerPixelY \ 2 + imgIcon.Top + imgIcon.Height
  190.     lblCopyright2.Top = CTL_SPACE% * Screen.TwipsPerPixelY * 2 + lblCopyright1.Top + lblCopyright1.Height
  191.     cmdOK.Top = CTL_SPACE% * Screen.TwipsPerPixelY + lblCopyright2.Top + lblCopyright2.Height
  192.     'form height
  193.     Me.Height = intFormSysVSize% + cmdOK.Top + cmdOK.Height + CTL_SPACE% * Screen.TwipsPerPixelY
  194.     'form width
  195.     Me.Width = intFormSysHSize% + intCtlMaxWidth%
  196.     imgCat.Left = Me.ScaleWidth / 2 - imgCat.Width / 2
  197.     imgCat.Top = Me.ScaleHeight / 2 - imgCat.Height / 2
  198.     'Set each property to display at center of form
  199.     lblTitle.Left = Me.ScaleWidth / 2 - lblTitle.Width / 2
  200.     imgIcon.Left = Me.ScaleWidth / 2 - imgIcon.Width / 2
  201.     lblCopyright1.Left = Me.ScaleWidth / 2 - lblCopyright1.Width / 2
  202.     lblCopyright2.Left = Me.ScaleWidth / 2 - lblCopyright2.Width / 2
  203.     cmdOK.Left = Me.ScaleWidth / 2 - cmdOK.Width / 2
  204. End Sub
  205.